from fastapi import APIRouter


def init_router():
    router = APIRouter()
    add_router(router)
    return router


def add_router(router: APIRouter):
    from api.v1.clientapi.user.client_user import router as client_user_router
    from api.v1.clientapi.user.client_user import login_router as client_login_router
    from api.v1.clientapi.mall.order import router as order_router
    from api.v1.clientapi.pay.pay import router as pay_router
    from api.v1.clientapi.pay.pay import demo_router as demo_pay_router

    router.include_router(client_user_router, prefix="/v1")
    router.include_router(client_login_router, prefix="/v1")
    router.include_router(order_router, prefix="/v1/mall/{code:str}")
    router.include_router(pay_router, prefix="/v1")
    router.include_router(demo_pay_router, prefix="/v1")